package com.atguigu.juc.t2;

public class test1 {
    public static void main(String[] args) {
        System.out.println(Thread.currentThread().getName() + "我是刘备");

        Thread gy = new Thread(()->{
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println(Thread.currentThread().getName() + "我是关羽");
        });

        Thread zf = new Thread(()->{
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println(Thread.currentThread().getName() + "我是张飞");
        });

        gy.setDaemon(true);
        zf.setDaemon(true);

        System.out.println(Thread.currentThread().getName() + "刘备嘎了");
    }
}
